/**
 * Created by Administrator on 2017/3/10.
 *
 * ref:必须 为button设置唯一ref,方便操作
 * onclick：必须，函数返回值为true才执行倒计时
 * count:倒计时秒数，默认5秒
 *
 */
var GetCode = require('../../../src/libs/get-code');
var Root = React.createClass({
    componentDidMount:function(){
        UEventHub.on('getcode',function(v){
            console.log(v)
            if(v == PageDM.getCode){
                this.refs.test.toCount();
            }else{
                this.refs.test1.toCount();
            }
        }.bind(this));
    },
    render:function(){
        return(
            <div>
                <GetCode className="ucs-btn-full" ref="test" count={5} onClick={PageDM.getCode.onClick}/>
                <GetCode className="ucs-btn-confirm" ref="test1" count={15} onclick={PageDM.getCode2.onClick}/>
            </div>
        )
    }
});
ReactDOM.render(<Root/>, document.getElementById('main'));